From 3d43eba94105559027f73cd582f5e0a13bdfccf2 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Mon, 14 Aug 2006 10:58:02 +0100 Subject: [PATCH] [XEN] Remove sync_pagetable_state(). No longer needed. Signed-off-by: Keir Fraser --- xen/arch/x86/mm.c | 31 ------------------------------- xen/arch/x86/traps.c | 3 --- xen/common/domain.c | 6 ------ xen/common/grant_table.c | 2 -- xen/include/asm-ia64/mm.h | 2 -- xen/include/asm-powerpc/mm.h | 2 -- xen/include/asm-x86/mm.h | 2 -- 7 files changed, 48 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 35c73a83a5..9664a2cda0 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1657,26 +1657,6 @@ int get_page_type(struct page_info *page, unsigned long type) { if ( unlikely((x & PGT_type_mask) != (type & PGT_type_mask) ) ) { - if ( (current->domain == page_get_owner(page)) && - ((x & PGT_type_mask) == PGT_writable_page) ) - { - /* - * This ensures functions like set_gdt() see up-to-date - * type info without needing to clean up writable p.t. - * state on the fast path. We take this path only - * when the current type is writable because: - * 1. It's the only type that this path can decrement. - * 2. If we take this path more liberally then we can - * enter a recursive loop via get_page_from_l1e() - * during pagetable revalidation. - */ - sync_pagetable_state(current->domain); - y = page->u.inuse.type_info; - /* Can we make progress now? */ - if ( ((y & PGT_type_mask) == (type & PGT_type_mask)) || - ((y & PGT_count_mask) == 0) ) - goto again; - } if ( ((x & PGT_type_mask) != PGT_l2_page_table) || ((type & PGT_type_mask) != PGT_l1_page_table) ) MEM_LOG("Bad type (saw %" PRtype_info @@ -1937,8 +1917,6 @@ int do_mmuext_op( LOCK_BIGLOCK(d); - sync_pagetable_state(d); - if ( unlikely(count & MMU_UPDATE_PREEMPTED) ) { count &= ~MMU_UPDATE_PREEMPTED; @@ -2190,8 +2168,6 @@ int do_mmu_update( LOCK_BIGLOCK(d); - sync_pagetable_state(d); - if ( unlikely(shadow_mode_enabled(d)) ) check_pagetable(v, "pre-mmu"); /* debug */ @@ -2701,8 +2677,6 @@ int do_update_va_mapping(unsigned long va, u64 val64, LOCK_BIGLOCK(d); - sync_pagetable_state(d); - if ( unlikely(shadow_mode_enabled(d)) ) check_pagetable(v, "pre-va"); /* debug */ @@ -3337,11 +3311,6 @@ int ptwr_do_page_fault(struct domain *d, unsigned long addr, return 0; } -void sync_pagetable_state(struct domain *d) -{ - shadow_sync_all(d); -} - int map_pages_to_xen( unsigned long virt, unsigned long mfn, diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 5fd31cf4e6..839b5e0c51 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -713,7 +713,6 @@ static int handle_gdt_ldt_mapping_fault( { /* LDT fault: Copy a mapping from the guest's LDT, if it is valid. */ LOCK_BIGLOCK(d); - sync_pagetable_state(d); ret = map_ldt_shadow_page(offset >> PAGE_SHIFT); UNLOCK_BIGLOCK(d); @@ -849,7 +848,6 @@ static int spurious_page_fault( int is_spurious; LOCK_BIGLOCK(d); - sync_pagetable_state(d); is_spurious = __spurious_page_fault(addr, regs); UNLOCK_BIGLOCK(d); @@ -1302,7 +1300,6 @@ static int emulate_privileged_op(struct cpu_user_regs *regs) case 3: /* Write CR3 */ LOCK_BIGLOCK(v->domain); - sync_pagetable_state(v->domain); (void)new_guest_cr3(gmfn_to_mfn(v->domain, xen_cr3_to_pfn(*reg))); UNLOCK_BIGLOCK(v->domain); break; diff --git a/xen/common/domain.c b/xen/common/domain.c index ef95ff5b2e..284bbee0c4 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -266,8 +266,6 @@ static void domain_shutdown_finalise(void) vcpu_sleep_sync(v); BUG_ON(!cpus_empty(d->domain_dirty_cpumask)); - sync_pagetable_state(d); - /* Don't set DOMF_shutdown until execution contexts are sync'ed. */ if ( !test_and_set_bit(_DOMF_shutdown, &d->domain_flags) ) send_guest_global_virq(dom0, VIRQ_DOM_EXC); @@ -406,8 +404,6 @@ void domain_pause(struct domain *d) for_each_vcpu( d, v ) vcpu_sleep_sync(v); - - sync_pagetable_state(d); } void domain_unpause(struct domain *d) @@ -439,8 +435,6 @@ void domain_pause_by_systemcontroller(struct domain *d) for_each_vcpu ( d, v ) vcpu_sleep_sync(v); } - - sync_pagetable_state(d); } void domain_unpause_by_systemcontroller(struct domain *d) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 81f3f94738..5ef0677563 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -942,8 +942,6 @@ do_grant_table_op( LOCK_BIGLOCK(d); - sync_pagetable_state(d); - rc = -EFAULT; switch ( cmd ) { diff --git a/xen/include/asm-ia64/mm.h b/xen/include/asm-ia64/mm.h index bdd688b34d..5bc654802d 100644 --- a/xen/include/asm-ia64/mm.h +++ b/xen/include/asm-ia64/mm.h @@ -500,6 +500,4 @@ extern u64 translate_domain_pte(u64 pteval, u64 address, u64 itir__, u64* logps, int steal_page( struct domain *d, struct page_info *page, unsigned int memflags); -#define sync_pagetable_state(d) ((void)0) - #endif /* __ASM_IA64_MM_H__ */ diff --git a/xen/include/asm-powerpc/mm.h b/xen/include/asm-powerpc/mm.h index 8ad51158dc..91e757912f 100644 --- a/xen/include/asm-powerpc/mm.h +++ b/xen/include/asm-powerpc/mm.h @@ -224,6 +224,4 @@ static inline unsigned long gmfn_to_mfn(struct domain *d, unsigned long gmfn) extern int steal_page(struct domain *d, struct page_info *page, unsigned int memflags); -#define sync_pagetable_state(d) ((void)0) - #endif diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index b5b9edee0a..dc96970c55 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -312,8 +312,6 @@ int ptwr_do_page_fault(struct domain *, unsigned long, struct cpu_user_regs *); int revalidate_l1(struct domain *, l1_pgentry_t *, l1_pgentry_t *); -void sync_pagetable_state(struct domain *d); - int audit_adjust_pgtables(struct domain *d, int dir, int noisy); #ifndef NDEBUG -- 2.30.2